Ext.onReady(function()
{
    try
    {
        Ext.Loader.setConfig(
        {
            enabled : true
        });

        Ext.USE_NATIVE_JSON = true;

        Ext.Loader.setPath(
        {
            'UM' : 'app',
        });
        Ext.application(
        {
            name : 'UM',

            appFolder : 'app',

            appProperty : 'appThis',

            requires :
            [
                'UM.util.ServerDataUpdater'
            ],

            controllers :
            [
                'ThemesController'
            ],

            setPageTitle : function(title)
            {
                document.title = 'User Manager : ' + title;
            },

            launch : function()
            {
                var me = this;
                me.loadingMask = new Ext.LoadMask(Ext.getBody(),
                {
                    msg : "Data loading..."
                });

                console.log('entered');
                //console.log("ExtJS version:" + Ext.versions.extjs.toString());
                me.buildViewport();
                me.loadingMask.show();
                ServerDataUpdater.loadData('getThemes', ServerDataUpdater.GET,
                {
                    success : function(resp)
                    {
                        var mainContainer = Ext.ComponentQuery.query('#mainContainerId')[0];
                        mainContainer.fireEvent('themesLoaded', resp);
                        me.loadingMask.hide();
                    },

                    failure : function()
                    {
                        me.loadingMask.hide();
                    }
                });
            },

            buildViewport : function()
            {
                UM.viewport = Ext.create('UM.view.RootViewport');
            }

        });
    } catch (err)
    {
        console.log(err);
        //Log.debug(err);
    }
});